<template>
  <div>
    <div class="container skeleton">
      <div class="row" v-for="(item, index) in list" :key="index">
        <div class="name skeleton-rect">{{ item.name }}</div>
        <div class="age skeleton-rect">{{ item.address }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { Button } from "vant";
import { apiGetUser } from "@/api/app";
import { utils, deepClone } from "comm-utils-lxx";
console.log("%c" + "utils", "background: green; color: #fff;");
console.log(utils);
console.log(deepClone);

export default {
  name: "Home",
  components: {
    [Button.name]: Button,
  },
  data() {
    return {
      list: [
        { name: "张三", address: "重庆市两江新区" },
        { name: "李四", address: "重庆市渝北区" },
        { name: "王小明", address: "重庆市沙坪坝区大学城" },
      ],
    };
  },
  created() {
    this.ApiGetUser();
  },

  methods: {
    // 获取用户信息
    async ApiGetUser() {
      const res = await apiGetUser();
      this.$store.commit("SET_SKELETON", false);
      console.log("%c" + "res", "background: green; color: #fff;");
      console.log(res);
    },
  },
};
</script>

<style lang="less" scoped>
.row:extend(.g-flex-box-sb) {
  margin-bottom: 10px;
}
</style>
